<?php
namespace app\admin\controller;

use think\Controller;
use think\Session;

class Com extends Controller
{
    public function _initialize(){
        $admin_user=Session::get('admin_user');
        //判断session是否存在
        if(empty($admin_user)){
            //跳转到 登陆页

            $this->success('请先登录,谢谢',"login/index");
        }
    }
}

?>